add = function () {
    let fname =     $("#fname").value
    let price = $("#price").value
    let fcount = $("#fcount").value
    let remark= $("#remark").value
    axios({
        method: 'post',
        url: "add",
        data: {
            fname: fname,
            price: price,
            fcount: fcount,
            remark: remark,

        }}).then(response => {
        let flag = response.data.flag;
        let msg = response.data.msg;

        if (flag) {
            window.location.href = "index.html";

            window.alert(msg);
        }

    });}
checkFname=function () {
    let fname =     $("#fname").value
    axios({
        method: 'get',
        url: "getFname",
        params: {
            fname: fname,

        }
    }).then(response => {
        let fnameSpan = $("#fnameSpan");
        if (response.data.flag) {
            fnameSpan.innerText = "可添加";
            fnameSpan.style.color = "blue";

        } else {
            fnameSpan.innerText = "不可添加";
            fnameSpan.style.color = "red";

        }
    });
}